#encoding:utf-8
from django.conf.urls import url

from books import views
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from books.models import *

urlpatterns = [
    url(r'^$',views.index, name='index'),
    url(r'^reg$',views.reg, name='reg'),
    url(r'^my_login/$',views.my_login, name='my_login'), #name 值是在template 中用url 标签引用的
    url(r'^list/$', ListView.as_view(model=News, template_name='books/listview.html')),#template_name django 会自动推出mews_list 或者直接指定template_name='books/listview.html'
    url(r'^success/$',views.personal_page,name = 'personal_page'),
    url(r'^base_view/$',views.my_view.as_view())
]